package com.cisco.pso;

import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;
/**
 * this class can generate base code diff (file list), which can be used by official PSO code diff tool.
 * @author jackding
 *
 */
public class BaseDiffFileList {
	public static void main(String[] args) {

		String site = "chemical";
		String siteAbbreviation = "che";

		String baseLeftPath = "base/Base-T29L10NSP8.1/";
		String baseRightPath = "base/Base-T29L.13.1.10003/";

		String psoLeftPath = "pso/T27LC/";
		String psoRightPath = "pso/T28L/";

		String baseFileList = "base_old_file_list";
		String baseDiffFile = "base_diff_file_list";

		// String psoDiffFile = "pso_chemical_" + module + "_diff";
		String psoFileList = "pso_" + site + "_file_list";

		String reviseFile = null;
		reviseFile = site + "-revise";

		InputStreamReader baseFileListInput = new InputStreamReader(
				Merger.class.getClassLoader().getResourceAsStream(baseFileList));

		InputStreamReader baseDiffInput = new InputStreamReader(Merger.class
				.getClassLoader().getResourceAsStream(baseDiffFile));
 
		FileListReader baseLR = new FileListReader(baseFileListInput);
		DiffReader baseDiffResult = new DiffReader(baseDiffInput, baseLeftPath,
				baseRightPath);
 
		int i=0;
		for(DiffResult dr: baseDiffResult.getResults()){
			i++;
			if(dr.leftFile!=null)
			{
				String file = dr.leftFile.substring(baseLeftPath.length());
				System.out.println(file);
			}
		}

		 
	}

}
